//
//  MessDetailCollectionViewCell.m
//  Youhuiju
//
//  Created by 余尚飞 on 16/8/30.
//  Copyright © 2016年 yutenys. All rights reserved.
//

#import "MessDetailCollectionViewCell.h"

@interface MessDetailCollectionViewCell ()

@property (weak, nonatomic) IBOutlet UILabel *titleLabel;

//适配
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *titleTop;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *titleLeading;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *titleHeight;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *messNextImgTrailing;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *messNextImgWid;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *messNextImgHeight;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *contentTop;


@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *contentTrailing;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *lineTop;

@end
@implementation MessDetailCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.titleTop.constant = 14 * FitH;
    self.titleLeading.constant = 14 *  FitW;
    self.titleHeight.constant = 15 * FitH;
    self.titleLabel.font = [UIFont systemFontOfSize:15 * FitH];
    
    self.messNextImgTrailing.constant = 28 * FitW;
    self.messNextImgWid.constant = 8 * FitW;
    self.messNextImgHeight.constant = 14 * FitH;
    
    self.contentTop.constant = 23 * FitH;
    self.contentTrailing.constant = 57 * FitW;
    self.contentLabel.font = [UIFont systemFontOfSize:14 * FitH];
    
    self.lineTop.constant = 11 * FitH;
    
    
    
    // 设置字体间每行的间距
    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    paragraphStyle.lineHeightMultiple = 15.0f * FitH;
    paragraphStyle.maximumLineHeight = 15.0f * FitH;
    paragraphStyle.minimumLineHeight = 15.0f * FitH;
    paragraphStyle.lineSpacing = 10.0f * FitH;// 行间距
    NSString *string = @"兰蔻[小黑瓶]全规格精华肌底液 面部精华直达肌底补水保湿弹润";
    NSDictionary *ats = @{
                          NSParagraphStyleAttributeName : paragraphStyle,
                          };
    self.contentLabel.attributedText = [[NSAttributedString alloc] initWithString:string attributes:ats];
    
    // Initialization code
}

@end
